package src.main.CreationalPatterns.AbstractFactory;

public class Client {
    public static void main(String[] args) {
        // 创建精灵装备族（参考网页8）
        EquipmentFactory elfFactory = new ElfFactory();
        Weapon elfWeapon = elfFactory.createWeapon();
        Armor elfArmor = elfFactory.createArmor();

        elfWeapon.attack();  // 输出：[精灵长弓]
        elfArmor.defend();   // 输出：[精灵皮甲]
        System.out.println("精灵套装战斗力：" +
                (elfWeapon.getAttackPower() + elfArmor.getDefenseValue()));

        // 创建兽人装备族
        EquipmentFactory orcFactory = new OrcFactory();
        Weapon orcWeapon = orcFactory.createWeapon();
        Armor orcArmor = orcFactory.createArmor();

        orcWeapon.attack();  // 输出：[兽人战斧]
        orcArmor.defend();   // 输出：[兽人重甲]
        System.out.println("兽人套装战斗力：" +
                (orcWeapon.getAttackPower() + orcArmor.getDefenseValue()));
    }
}
